package cn.ydt.ydt.pojo.user.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;

@ApiModel(value = "用户注册DTO")
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
public class UserRegisterDTO {

    private Long userId;

    @ApiModelProperty(value = "用户id")
    @NotNull(message = "用户名不能为空")
    private String userName;

    @ApiModelProperty(value = "用户身份证号")
    @NotNull(message = "身份证号不能为空")
    @Pattern(regexp = "^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$",
             message ="身份证由18位组成" )
    private String idNumber;


    @ApiModelProperty(value = "用户密码")
    @NotNull(message = "密码不能为空")
    private String userPassword;

    @ApiModelProperty(value = "用户手机号")
    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = "^[1][3,4,5,7,8][0-9]{9}$",
            message = "电话必须为11位数字,且按照第几位特殊化比如第二位只能为 3、5、7、8")
    private String userPhone;


    @ApiModelProperty(value = "生日")
    private Date birthday;

    /**
     * 居民住址
     */
    @ApiModelProperty(value = "用户地址")
    private String userAddress;
}
